﻿<?xml version="1.0" encoding="utf-8"?><Articles><Article><ArticlesID>542</ArticlesID><Title>Fixing Debug Error: The following module was built either with optimization enabled or without deb</Title><Body>&amp;lt;p&amp;gt;&amp;lt;span id=&amp;quot;lblBox&amp;quot;&amp;gt;When attempting to step through an application, you may receive an error message such as -&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;b&amp;gt;&amp;lt;br /&amp;gt;
The following module was built with optimizations enabled or without debug information:&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
{Path to DLL}&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
To debug this module, change its project build configuration to Debug mode. To supress this message, disable the 'Warn if no user code on launch' debugger option.&amp;lt;br /&amp;gt;
&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
At this point you may confirm the prompt and your application will continue to load as normal. It will, however, ignore any debugging instructions you have givin it, such as breakpoints. This is the result of the way the code was built, and there are two approaches to solve it:&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;b&amp;gt;1 - Ignore the message...&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
To simply make this prompt no longer appear, you can do the following:&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
Go to Tools --&amp;amp;gt; Options --&amp;amp;gt; Debugging --&amp;amp;gt; General&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
At this point, unselect 'Enable Just My Code (Managed Only)'.&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
This should now rid you of the prompt.&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;b&amp;gt;2 - Allow Debugging...&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
Due to the nature in which one of the assemblies has been built in your application, you will need to change a few settings to allow the code to be handled by the Visual Studio Debugger.&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
Right click on any project in question from the solution explorer and select 'Properties'. This will open up the project properties panel giving us access to a great many options for our projects. Navigate to the 'Complile' Tab (or 'Build' if your in a C# environment) and select 'Advanced Compile Options...' from the bottom of the screen. This presents us with a prompt that has two key areas of interest:&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
1) Optimizations - uncheck 'Enable Optimizations'&amp;lt;br /&amp;gt;
2) Generate debug info - Ensure that the option is set to 'Full'&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
A final issue to consider before proceeding is that the project is set to be built in Debug mode (as opposed to Release Mode). Release mode strips our code of the ability to do any fine detail debugging as its goal is to slim down and secure our assemblies for a production environment. While still on the Complile/Build tab ensure that 'Configuration' is set to Active(Debug) (or, alternatively, in the toolbar ensure it is set to Debug). When this option is properly set, the project will be built with full debugging capabilities included and accessible.&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
Content - Visual Studio 2008, Visual Studio 2005, VB.NET, C#.NET, Debugging&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;span&amp;gt;stellarpc.com&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;</Body><CommentEnabled>True</CommentEnabled><ViewCount>0</ViewCount><ReleaseDate>10/23/2009 6:07:10 AM</ReleaseDate><TotalComment>0</TotalComment><IsMedia>False</IsMedia><IsPicture>False</IsPicture><IsVote>True</IsVote><ArticlePassword /><PostVisible>0</PostVisible><ArticlePath>/2009/10/23/Fixing-Debug-Error-The-following-module-was-built-either-with-optimization-enabled-or-without-deb-21E</ArticlePath><Approved>True</Approved><ImagePath /><CategoryId>26</CategoryId><ArrayCatID>26|25</ArrayCatID></Article></Articles>